---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: unused
spec:
  template:
    spec:
      initContainers:
      - name: cc-wait
        # yamllint disable-line rule:line-length
        image: gcr.io/pixie-oss/pixie-dev-public/curl:multiarch-7.87.0@sha256:f7f265d5c64eb4463a43a99b6bf773f9e61a50aaa7cefaf564f43e42549a01dd
        # yamllint disable rule:indentation
        command: ['sh', '-c', 'set -x;
          URL="https://${SERVICE_NAME}:${SERVICE_PORT}/readyz";
          until [ $(curl -m 0.5 -s -o /dev/null -w "%{http_code}" -k ${URL}) -eq 200 ]; do
            echo "waiting for ${URL}";
            sleep 2;
          done;
        ']
        # yamllint enable rule:indentation
        env:
          # The name of the service that Kelvin must connect with before becoming available.
        - name: SERVICE_NAME
          value: "vizier-cloud-connector-svc"
        - name: SERVICE_PORT
          value: "50800"
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
          seccompProfile:
            type: RuntimeDefault
      containers:
      - name: app
        env:
        - name: PL_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: PL_CLUSTER_ID
          valueFrom:
            secretKeyRef:
              key: cluster-id
              name: pl-cluster-secrets
        - name: PL_SENTRY_DSN
          valueFrom:
            secretKeyRef:
              key: sentry-dsn
              name: pl-cluster-secrets
              optional: true
